<html>
<head>
 <script>
   function onLoad() {
    var anchor = document.getElementById("anchorTag");
    anchor.addEventListener("dragstart", function(event) { document.title = "anchor dragstart"; });
    anchor.addEventListener("contextmenu", function(event) { document.title = "anchor contextmenu"; });

    var image = document.getElementById("imageTag");
    image.addEventListener("dragstart", function(event) { document.title = "image dragstart"; });
    image.addEventListener("contextmenu", function(event) { document.title = "image contextmenu"; })
  }
</script>
</head>
<body onload="onLoad()">
  <a id="anchorTag" href="http://www.example.com">Link to example.com</a>
    <img id="imageTag" src="foo.png" width="100" height="100"> Link to an image. </img>
</body>
<html>
